package org.tis.tools.abf.module.ac.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.tis.tools.abf.module.ac.service.IAcFuncService;
import org.tis.tools.model.common.ResultVO;

import javax.validation.constraints.NotBlank;

/**
 * 对外提供查询功能行为
 * Created by chenchao
 * Created on 2018/10/19 9:34
 */
@RestController
@RequestMapping("/v1/api/acFunc")
@Api(description = "功能行为对外服务")
@Validated
@Slf4j
public class AcFuncApiController {

    @Autowired
    private IAcFuncService acFuncService;

    @ApiOperation(value = "根据应用查询功能行为",notes = "传入应用GUID作为参数")
    @GetMapping("/{appId}/getFuncBehave")
    public ResultVO getFuncBehave(@PathVariable @NotBlank @ApiParam(value = "appId",name = "应用GUID",required = true) String appId) {
        return ResultVO.success("查询成功", acFuncService.getFuncBehave(appId));
    }

}